package org.example.leetCode;

import java.util.Arrays;

/**
 * @author Vader
 * @date 2021/12/30
 **/
public class IsNStraightHand {
    public boolean isNStraightHand(int[] hand, int groupSize) {
        int length = hand.length;
        if (length == 1 & length == groupSize) {
            return true;
        }
        if (length == groupSize || length % groupSize != 0) {
            return false;
        }

        Arrays.sort(hand);
        int[] ints = new int[hand[length - 1]];

        for (int i : hand) {
            ints[i] = ++ints[i];
        }
        return false;
    }
}
